//
//  Config.h
//  Growth
//
//  Created by Hobo.Chen on 12/27/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//


#pragma mark 角色
#define ROLE @"role" //1.孕妇 2.社区医院  3.中心医院

#define BarTintColor  [UIColor colorWithRed:244.0/255.0 green:181.0/255.0 blue:122.0/255.0 alpha:0.5]

#define iOS7 ([UIDevice currentDevice].systemVersion.floatValue >= 7)
#define iPhone5 ([UIScreen mainScreen].bounds.size.height > 480)

//社区名称
#define COMPANYNAME  @"CompanyName"

#define GROWTH_LASTEST_VERSION_KEY @"LASTEST_VERSION_KEY"
#define GROWTH_LOCALE_VERSION_KEY @"LOCALE_VERSION_KEY"
#define VERSION @"iPhone 1.2" 

#define IOS_DEVICE_ID 3
#define APP_ID 1
#define DEVICE_TOKEN_KEY @"DEVICE_TOKEN_KEY"


#define REGIST_LOGIN_KEY @"REGIST_LOGIN_KEY"

#define REGEX_EMAIL  @"^[A-Za-z0-9][\\w\\-\\.]{1,12}@([\\w\\-]+\\.)+[\\w]{2,3}$"
#define REGEX_PHONE  @"^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$"
#define REGEX_NICKNAME  @"^[\u4E00-\u9FA5a-zA-Z0-9]{2,10}$"

#pragma mark - 设置

#define PHOTO_QUALITY_HD        0.5
#define PHOTO_QUALITY_NORMAL    0.3

#define PHOTO_MAXPIX_HD        1024
#define PHOTO_MAXPIX_NORMAL    1024


#define USER_ID  @"userId"
#define USER_NAME  @"UserName"
#define USER_KEY  @"loginkey"

//数据库版本验证
#define VERIFY_LOCALE_DATABASE_KEY @"VERIFY_LOCALE_DATABASE_KEY"
#define VERIFY_LOCALE_DATABASE_VERSION @"LOCALE_DATABASE_V2.0"

//效验本地时间
#define VERIFY_LOCALE_DATE_KEY @"VERIFY_LOCALE_DATE_KEY"
#define VERIFY_LOCALE_DATE_INTERVAL [[[NSUserDefaults standardUserDefaults]valueForKey:VERIFY_LOCALE_DATE_KEY] intValue]

//相册图片3G网络使用
#define ALBUM_UPLOAD_IS_3G_KEY  @"ALBUM_UPLOAD_IS_3G_KEY"
#define ALBUM_UPLOAD_IS_3G [[[NSUserDefaults standardUserDefaults]valueForKey:ALBUM_UPLOAD_IS_3G_KEY] boolValue]

//图片
#define PHOTO_IS_HD_KEY @"PHOTO_IS_HD_KEY"
#define PHOTO_IS_HD     [[[NSUserDefaults standardUserDefaults]valueForKey:PHOTO_IS_HD_KEY] boolValue]
#define PHOTO_QUALITY [[[NSUserDefaults standardUserDefaults]valueForKey:PHOTO_IS_HD_KEY] boolValue]? PHOTO_QUALITY_HD:PHOTO_QUALITY_NORMAL

#define PHOTO_MAXPIX [[[NSUserDefaults standardUserDefaults]valueForKey:PHOTO_IS_HD_KEY] boolValue]? PHOTO_MAXPIX_HD:PHOTO_MAXPIX_NORMAL

#pragma mark - 网络
#define NETWORK_STATUS_LOADING [[NetworkEngine sharedNetworkEngine] checkNetWorkStatusLoading]
#define NETWORK_STATUS_UNLOADING [[NetworkEngine sharedNetworkEngine] checkNetWorkStatusUnLoading]



//提醒
//记录提醒
#define RECORD_ALERT_KEY    @"RECORD_ALERT_KEY"
#define RECORD_ALERT        [[[NSUserDefaults standardUserDefaults]valueForKey:RECORD_ALERT_KEY] boolValue]
#define RECORD_ALERT_TIME_KEY  @"RECORD_ALERT_TIME_KEY"
#define RECORD_ALERT_TIME       [[NSUserDefaults standardUserDefaults]valueForKey:RECORD_ALERT_TIME_KEY]?[[NSUserDefaults standardUserDefaults]valueForKey:RECORD_ALERT_TIME_KEY]:@"20:00"

//懒宝说提醒
#define LANBAOSHUO_ALERT_KEY    @"LANBAOSHUO_ALERT_KEY"
#define LANBAOSHUO_ALERT        [[[NSUserDefaults standardUserDefaults]valueForKey:LANBAOSHUO_ALERT_KEY] boolValue]
#define LANBAOSHUO_ALERT_TIME_KEY  @"LANBAOSHUO_ALERT_TIME_KEY"
#define LANBAOSHUO_ALERT_TIME       [[NSUserDefaults standardUserDefaults]valueForKey:LANBAOSHUO_ALERT_TIME_KEY]?[[NSUserDefaults standardUserDefaults]valueForKey:LANBAOSHUO_ALERT_TIME_KEY]:@"20:00"

//大事记
#define EVENT_ALERT_KEY    @"EVENT_ALERT_KEY"
#define EVENT_ALERT        [[[NSUserDefaults standardUserDefaults]valueForKey:EVENT_ALERT_KEY] boolValue]

//疫苗提醒
#define VACCINE_ALERT_KEY    @"VACCINE_ALERT_KEY"
#define VACCINE_ALERT        [[[NSUserDefaults standardUserDefaults]valueForKey:VACCINE_ALERT_KEY] boolValue]

//动态提醒
#define TREND_ALERT_KEY    @"TREND_ALERT_KEY"
#define TREND_ALERT        [[[NSUserDefaults standardUserDefaults]valueForKey:TREND_ALERT_KEY] boolValue]




#pragma mark -
#pragma mark 第三方登陆

//qq三方登陆
#define QQAccessToken @"QQAccessToken"
#define QQExpirationDate @"QQExpirationDate"
#define QQOpenId @"QQOpenId"
#define QQAPPKey @"100283210"

//weibo三方登陆
#import "WBEngine.h"
#import "WBSendView.h"
#import "WBLogInAlertView.h"
#define kWBSDKDemoAppKey @"4262987471"
#define kWBSDKDemoAppSecret @"7bbf7a1c3ca68db9e5a4041a23329ada"



#pragma mark -

#define DEFAULT_LOADING_TIME 2.0



#define BASEURL   @"http://211.83.105.216:8088"
#define UCENTERBASEURL   @"http://211.83.105.216:8088"

#define UCENTER_AUTHORIZATION @"growth.ios1.2:675fe3704d9515489f4bf38d4111549b"
 
#define kWebRequestTimeoutInterval 5.0

#define kDatabaseName @"databaseunco.sqlite3"

#define degreesToRadian(x) (M_PI * (x) / 180.0)
#define kDEFAULT_DATE_TIME_FORMAT (@"yyyy-MM-dd HH:mm:ss")


//颜色定义
#define Text_Color [UIColor colorWithRed:70.0/255.0 green:155.0/255.0 blue:57.0/255.0 alpha:1.0]
#define BackGround_Color [UIColor colorWithRed:240.0/255.0 green:233.0/255.0 blue:220.0/255.0 alpha:1.0]
#define Line_Color [UIColor colorWithRed:237.0/255.0 green:233.0/255.0 blue:226.0/255.0 alpha:1.0]
#define  Shadow_Color [UIColor colorWithRed:141.0f/255.0f green:141.0f/255.0f blue:141.0f/255.0f alpha:1.0]
#define BarTintColor [UIColor blackColor]


//userdefault keys

#define BABYINFO @"babyInfoDictionary"
#define TimelineMemberDict @"timelineMemberDict"

//userDefault 
#define BABY_ATTACHMENTID @"attachmentId"


#define PageSize 20



#define kDefaultTipsLoadingDuration 0.05


#define kCustomButtonHeight		30.0

//View Index
#define kContentViewIndex 1
#define kSystemViewIndex 5
#define kMenuViewIndex 10
#define kTopViewIndex 10000

//图片存储类型
#define kImageCache_Default             @"kImageCache_Default"

#define kImageCache_Content_Icon        @"kImageCache_Content_Icon"
#define kImageCache_Content_Browse      @"kImageCache_Content_Browse"

#define kImageCache_Album_Icon          @"kImageCache_Album_List"
#define kImageCache_Album_Browse        @"kImageCache_Album_Browse"

#define kImageCache_Locale_Album        @"kImageCache_Locale_Album"
#define kImageCache_Locale_Record       @"kImageCache_Locale_Record"



//加速计
#define kAccelerationThreshold		1.0
#define kUpdateInterval			(1.0f/10.0f)


//使用CLog输出日志，只在DEBUG情况下输出，使用Release则没有输出，免去上传时nslog的删除屏蔽工作
//PreProcessor Macros中设置DEBUG
#ifdef DEBUG
#define CLog(format, ...) NSLog(format, ## __VA_ARGS__)
#else
#define CLog(format, ...)
#endif
